Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Distributed transaction</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Distributed_transaction"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Distributed_transaction rootpage-Distributed_transaction skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Distributed transaction</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<p>A <b>distributed transaction</b> operates within a <a href="Distributed_computing" title="Distributed computing">distributed environment</a>, typically involving multiple nodes across a network depending on the location of the data. A key aspect of distributed transactions is <a href="Atomicity_(programming)" class="mw-redirect" title="Atomicity (programming)">atomicity</a>, which ensures that the transaction is completed in its entirety or not executed at all. It's essential to note that distributed transactions are not limited to <a href="Database" title="Database">databases</a>. <sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
</p><p><a href="The_Open_Group" title="The Open Group">The Open Group</a>, a vendor consortium, proposed the <a href="X/Open_XA" title="X/Open XA">X/Open Distributed Transaction Processing Model</a> (X/Open XA), which became a de facto standard for the behavior of transaction model components.
</p><p>Databases are common transactional resources and, often, transactions span a couple of such databases. In this case, a distributed transaction can be seen as a <a href="Database_transaction" title="Database transaction">database transaction</a> that must be <a href="Synchronization" title="Synchronization">synchronized</a> (or provide <a href="ACID" title="ACID">ACID</a> properties) among multiple participating <a href="Database" title="Database">databases</a> which are <a href="Distributed_computing" title="Distributed computing">distributed</a> among different physical locations. The <a href="Isolation_(computer_science)" class="mw-redirect" title="Isolation (computer science)">isolation</a> property (the I of ACID) poses a special challenge for multi database transactions, since the (global) <a href="Serializability" class="mw-redirect" title="Serializability">serializability</a> property could be violated, even if each database provides it (see also <a href="Global_serializability" title="Global serializability">global serializability</a>). In practice most commercial database systems use <a href="Two-phase_locking#Strong_strict_two-phase_locking" title="Two-phase locking">strong strict two-phase locking (SS2PL)</a> for <a href="Concurrency_control" title="Concurrency control">concurrency control</a>, which ensures global serializability, if all the participating databases employ it.
</p><p>A common <a href="Algorithm" title="Algorithm">algorithm</a> for ensuring <a href="Correctness_(computer_science)" title="Correctness (computer science)">correct</a> completion of a distributed transaction is the <a href="Two-phase_commit" class="mw-redirect" title="Two-phase commit">two-phase commit</a> (2PC). This algorithm is usually applied for updates able to <a href="Commit_(data_management)" title="Commit (data management)">commit</a> in a short period of time, ranging from couple of milliseconds to couple of minutes.
</p><p>There are also long-lived distributed transactions, for example a transaction to book a trip, which consists of booking a flight, a rental car and a hotel. Since booking the flight might take up to a day to get a confirmation, two-phase commit is not applicable here, it will lock the resources for this long. In this case more sophisticated techniques that involve multiple undo levels are used. The way you can undo the hotel booking by calling a desk and cancelling the reservation, a system can be designed to undo certain operations (unless they are irreversibly finished).
</p><p>In practice, long-lived distributed transactions are implemented in systems based on <a href="Web_Services" class="mw-redirect" title="Web Services">web services</a>. Usually these transactions utilize principles of <a href="Compensating_transaction" title="Compensating transaction">compensating transactions</a>, Optimism and Isolation Without Locking. The X/Open standard does not cover long-lived distributed transactions.
</p><p>Several technologies, including <a href="Enterprise_Java_Beans" class="mw-redirect" title="Enterprise Java Beans">Jakarta Enterprise Beans</a> and <a href="Microsoft_Transaction_Server" title="Microsoft Transaction Server">Microsoft Transaction Server</a> fully support distributed transaction standards.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Synchronization">Synchronization</h2></div>
<p>In <a href="Event-driven_architecture" title="Event-driven architecture">event-driven architectures</a>, distributed transactions can be <a href="Synchronization_(computer_science)" title="Synchronization (computer science)">synchronized</a> through using <a href="Request%E2%80%93response" title="Request–response">request–response</a> paradigm and it can be implemented in two ways: <sup id="cite_ref-:02_2-0" class="reference"><a href="#cite_note-:02-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>
</p>
<ul><li>Creating two separate <a href="Message_queue" title="Message queue">queues</a>: one for requests and the other for replies. The event producer must wait until it receives the response.</li>
<li>Creating one dedicated ephemeral <a href="Message_queue" title="Message queue">queue</a> for each request.</li></ul>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Java_Transaction_API" class="mw-redirect" title="Java Transaction API">Java Transaction API</a></li>
<li><a href="Enduro/X" title="Enduro/X">Enduro/X open-source X/Open XA and XATMI implementation</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFGray" class="citation book cs1">Gray, Jim. <i>Transaction Processing Concepts and Techniques</i>. Morgan Kaufmann. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>9780080519555</bdi>.</cite></span>
</li>
<li id="cite_note-:02-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-:02_2-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFRichards" class="citation book cs1">Richards, Mark. <i>Fundamentals of Software Architecture: An Engineering Approach</i>. O'Reilly Media. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-1492043454</bdi>.</cite></span>
</li>
</ol></div></div>
<ul><li><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20080511221610/http://xml.sys-con.com/read/43755.htm">"Web-Services Transactions"</a>. Archived from <a rel="nofollow" class="external text" href="http://xml.sys-con.com/read/43755.htm">the original</a> on May 11, 2008<span class="reference-accessdate">. Retrieved <span class="nowrap">May 2,</span> 2005</span>.</cite></li>
<li><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20180713045114/http://comet.lehman.cuny.edu/cocchi/CIS256/StudentReading/TransactionProcessing.doc">"Nuts And Bolts Of Transaction Processing"</a>. <i>Article about Transaction Management</i>. Archived from <a rel="nofollow" class="external text" href="http://comet.lehman.cuny.edu/cocchi/CIS256/StudentReading/TransactionProcessing.doc">the original</a> on July 13, 2018<span class="reference-accessdate">. Retrieved <span class="nowrap">May 3,</span> 2005</span>.</cite></li>
<li><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://gsraj.tripod.com/misc/ejbmtscomp.html">"A Detailed Comparison of Enterprise JavaBeans (EJB) &amp; The Microsoft Transaction Server (MTS) Models"</a>.</cite></li></ul>
<div class="mw-heading mw-heading2"><h2 id="Further_reading">Further reading</h2></div>
<ul><li>Gerhard Weikum, Gottfried Vossen, <i>Transactional information systems: theory, algorithms, and the practice of concurrency control and recovery</i>, Morgan Kaufmann, 2002, <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>1-55860-508-8</bdi></li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-02-01" href="https://en.wikipedia.org/wiki/?title=Distributed_transaction&amp;oldid=1273341622">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>